// 工具类函数 
// 格式化时间
export const formatTime = (times,time=false,datesep='-',timesep=':')=>{
    const ts = Number(times)
    const timeObj = new Date(ts);

    // 年
    const year = timeObj.getFullYear();
    const Month = (timeObj.getMonth()+1).toString().padStart(2,'0');
    const day = timeObj.getDate().toString().padStart(2,'0');
    if(time){
        //做时间相关处理
        const h = timeObj.getHours().toString().padStart(2,'0');
        const m = timeObj.getMinutes().toString().padStart(2,'0');
        const s = timeObj.getSeconds().toString().padStart(2,'0');
        return `${year}${datesep}${Month}${datesep}${day} 
        ${h}${timesep}${m}${timesep}${s}`
    }
    return `${year}${datesep}${Month}${datesep}${day}`

  
}